<script>
import { defineComponent } from 'vue'
import { VumViewer, __VumViewer } from 'vuesium'
import Event from './Event.vue'
import { Cartesian3 } from 'cesium'
import { viewerOptions, vecAnnoProvider } from './BaseMapConfig'
export default defineComponent({
  components: {
    VumViewer, Event
  },
  setup () {
    const viewLoad = ({ viewer }) => {
      viewer.scene.camera.setView({
        destination: new Cartesian3(
          -2340092.6398154306,
          5142273.774771423,
          3316533.4732605307),
        orientation: {
          heading: 0.0, // east, default value is 0.0 (north)
          pitch: -1.5706128109633317, // default value (looking down)
          roll: 0,
        },
      })
      viewer.imageryLayers.addImageryProvider(vecAnnoProvider)
      viewer._cesiumWidget._creditContainer.style.display = 'none'
    }
    return {
      viewerOptions,
      viewLoad,
    }
  },
})
</script>
<template>
  <VumViewer style="position: relative;height: 100%;" @load="viewLoad" :default-options="viewerOptions">
    <Event v-bind="$attrs"></Event>
    <slot></slot>
  </VumViewer>
</template>
<style lang='scss' scoped>
</style>